import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/homevideo_entity.dart';

HomevideoEntity $HomevideoEntityFromJson(Map<String, dynamic> json) {
  final HomevideoEntity homevideoEntity = HomevideoEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    homevideoEntity.id = id;
  }
  final String? experiencefieldImg = jsonConvert.convert<String>(
      json['ExperienceField_img']);
  if (experiencefieldImg != null) {
    homevideoEntity.experiencefieldImg = experiencefieldImg;
  }
  final String? experiencefieldVideo = jsonConvert.convert<String>(
      json['ExperienceField_video']);
  if (experiencefieldVideo != null) {
    homevideoEntity.experiencefieldVideo = experiencefieldVideo;
  }
  final String? txtZh = jsonConvert.convert<String>(json['txt_zh']);
  if (txtZh != null) {
    homevideoEntity.txtZh = txtZh;
  }
  final String? experiencefieldEn = jsonConvert.convert<String>(
      json['ExperienceField_en']);
  if (experiencefieldEn != null) {
    homevideoEntity.experiencefieldEn = experiencefieldEn;
  }
  final String? clubImgZh = jsonConvert.convert<String>(json['clubimg_zh']);
  if (clubImgZh != null) {
    homevideoEntity.clubImgZh = clubImgZh;
  }
  final String? clubImgEn = jsonConvert.convert<String>(json['clubimg_en']);
  if (clubImgEn != null) {
    homevideoEntity.clubImgEn = clubImgEn;
  }
  final String? newsJumpEn = jsonConvert.convert<String>(json['newsjump_en']);
  if (newsJumpEn != null) {
    homevideoEntity.newsJumpEn = newsJumpEn;
  }
  final String? newsImgZh = jsonConvert.convert<String>(json['newsimg_zh']);
  if (newsImgZh != null) {
    homevideoEntity.newsImgZh = newsImgZh;
  }
  final String? newsImgEn = jsonConvert.convert<String>(json['newsimg_en']);
  if (newsImgEn != null) {
    homevideoEntity.newsImgEn = newsImgEn;
  }
  return homevideoEntity;
}

Map<String, dynamic> $HomevideoEntityToJson(HomevideoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['ExperienceField_img'] = entity.experiencefieldImg;
  data['ExperienceField_video'] = entity.experiencefieldVideo;
  data['txt_zh'] = entity.txtZh;
  data['ExperienceField_en'] = entity.experiencefieldEn;
  data['clubimg_zh'] = entity.clubImgZh;
  data['clubimg_en'] = entity.clubImgEn;
  data['newsjump_en'] = entity.newsJumpEn;
  data['newsimg_zh'] = entity.newsImgZh;
  data['newsimg_en'] = entity.newsImgEn;
  return data;
}

extension HomevideoEntityExt on HomevideoEntity {
  HomevideoEntity copyWith({
    int? id,
    String? experiencefieldImg,
    String? experiencefieldVideo,
    String? txtZh,
    String? experiencefieldEn,
    String? clubImgZh,
    String? clubImgEn,
    String? newsJumpEn,
    String? newsImgZh,
    String? newsImgEn,
  }) {
    return HomevideoEntity()
      ..id = id ?? this.id
      ..experiencefieldImg = experiencefieldImg ?? this.experiencefieldImg
      ..experiencefieldVideo = experiencefieldVideo ?? this.experiencefieldVideo
      ..txtZh = txtZh ?? this.txtZh
      ..experiencefieldEn = experiencefieldEn ?? this.experiencefieldEn
      ..clubImgZh = clubImgZh ?? this.clubImgZh
      ..clubImgEn = clubImgEn ?? this.clubImgEn
      ..newsJumpEn = newsJumpEn ?? this.newsJumpEn
      ..newsImgZh = newsImgZh ?? this.newsImgZh
      ..newsImgEn = newsImgEn ?? this.newsImgEn;
  }
}